home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / CLRBMAP.H < prev    next >
Text File  |  1988-05-30  |  1KB  |  54 lines

  1. /* -*-C-*- clrbmap.h */
  2. /*-->clrbmap*/
  3. /**********************************************************************/
  4. /****************************** clrbmap *******************************/
  5. /**********************************************************************/
  6.  
  7. void
  8. clrbmap()
  9.  
  10. {
  11. #if    SEGMEM
  12.     register INT16 x,y;        /* loop indices */
  13.     register UNSIGN32 *p;    /* bitmap pointer */
  14.  
  15.     for (y = 0; y < YBIT; ++y)
  16.     {
  17.         p = (UNSIGN32*)BITMAP(y,0);
  18.  
  19. #if    FASTZERO
  20.     (void)zerom(p,(UNSIGN32)(XBIT));
  21. #else
  22.     for (x = 0; x < XBIT; (++p,++x))
  23.         *p = (UNSIGN32)0;
  24. #endif
  25.  
  26.     }
  27.  
  28. #else /* NOT SEGMEM */
  29. #if    FASTZERO
  30.  
  31. /***********************************************************************
  32. Fast assembly  language clear  -- runtime  histogramming showed  24%  of
  33. total time was spent  in this routine for  the large bitmap required  by
  34. the Toshiba P1315 180 dpi dvi driver!
  35. ***********************************************************************/
  36.     (void)zerom(bitmap,(UNSIGN32)(XBIT*YBIT));
  37.  
  38. #else /* NOT FASTZERO */
  39.  
  40.  
  41.     register INT32 nword;    /* loop index */
  42.     register UNSIGN32 *p;    /* bitmap pointer */
  43.  
  44.     p = (UNSIGN32*)BITMAP(YBIT-1,XBIT-1);    /* the last element */
  45.  
  46.     for (nword = (XBIT*YBIT); nword; (--nword,--p))
  47.     *p = (UNSIGN32)0;
  48.  
  49. #endif /* FASTZERO */
  50.  
  51. #endif /* SEGMEM */
  52. }
  53.  
  54.